package com.algorithms.recursives;

public class HanoiTower extends Thread {
	public void run(){
		doHanoiTower(5, "A", "B", "C");
	}
	
	public void doHanoiTower(int diskNo, String src, String mid, String des){
		if (diskNo == 1){
			System.out.println("disk " + diskNo + " move " + src + " -> " + des);
			return;
		}
		
		doHanoiTower(diskNo - 1, src, des, mid);
		System.out.println("disk " + diskNo + " move " + src + " -> " + des);
		doHanoiTower(diskNo - 1, mid, src, des);
	}
	
	public static void main(String args[]){
		new HanoiTower().start();
	}
}
